package com.example.demo.controller;

import com.example.demo.mail.SingleMailSend;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("/mail")
public class MailController {

    @RequestMapping("/active")
    public void emailActive(HttpServletRequest request, HttpServletResponse response){
        System.out.printf(request.getParameter("id"));
        System.out.printf(request.getParameter("token"));
    }

    @Autowired
    private SingleMailSend singleMailSend;
    @RequestMapping("/verify")
    public void emailVerify(HttpServletRequest request, HttpServletResponse response){
        String email=request.getParameter("email");
        String pwd=request.getParameter("pwd");

        singleMailSend.sendSimpleMail(email);

    }
}
